Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Preferred Movie Settings


SetMoviePreferredVolume

The SetMoviePreferredVolume function allows your application to set a movie's preferred volume setting.

pascal void SetMoviePreferredVolume (Movie theMovie, 
                                     short volume);
theMovie
Specifies the movie for this operation. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
volume
Specifies the preferred volume setting of the movie. The volume parameter must contain a 16-bit, fixed-point number that contains the movie's default volume. The high-order 8 bits contain the integer part of the value; the low-order 8 bits contain the fractional part. Volume values range from -1.0 to 1.0. Negative values play no sound but preserve the absolute value of the volume setting. You may find the following constants useful:
kFullVolume
Sets the movie to full volume (constant value is 1.0).
kNoVolume
Sets the movie to no volume (constant value is 0.0).
DESCRIPTION
Your application can obtain the preferred volume setting by calling the GetMoviePreferredVolume function, which is described in the next section. You can change a movie's current volume by calling the SetMovieVolume function, which is described on page 2-167.

A movie's tracks may have their own volume settings. Use the SetTrackVolume function, described on page 2-168, to set the volume of an individual track. A track's volume is scaled by the movie's volume to produce the track's final volume. Furthermore, the movie's volume is scaled by the sound volume that is returned by the Operating System's GetSoundVol routine (described in Inside Macintosh: More Macintosh Toolbox). Thus, the user can control the overall volume from the Sound control panel.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid
SEE ALSO
When a movie is loaded, the current setting is set to preferred volume. The StartMovie function (described on page 2-98) uses this volume setting when it starts playing a movie.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996